<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

class CreateCustomerEnterprisesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('customer_enterprises', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('customer_id');
            $table->string('name')->comment('店铺名称');
            $table->char('ebc_code', 10)->comment('电商企业代码');
            $table->string('ebc_name', 100)->comment('电商企业名称');
            $table->char('ebp_code', 10)->comment('电商平台代码');
            $table->string('ebp_name', 100)->comment('电商平台名称');
            $table->tinyInteger('assure')->default(0)->comment('税费担保企业:0 账册企业 1 电商企业');
            $table->timestamps();
        });
        DB::statement(/** @lang text */ "ALTER TABLE `customer_enterprises` comment '客户企业信息'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('customer_enterprises');
    }
}
